package com.hotdog.feign;


import com.hotdog.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * 远程调用System服务进行入库操作
 *
 * @author 郭鲁政
 */
@FeignClient(name = "system", contextId = "remoteUserService")
public interface SystemFeign {
    /**
     * 远程调用userController
     *
     * @param username
     * @return
     */
    @GetMapping("/user/login/{username}")
    User selectUserByUsername(@PathVariable("username") String username);

    /**
     * 远程调用userController
     *
     * @param userId
     * @return
     */
    @GetMapping("/user/permission/{userId}")
    List<String> selectUserPermissions(@PathVariable("userId") Long userId);

    @GetMapping("/log/insertLogInfo/{username}/{resourcesAccessed}")
    /**
     * 远程调用system服务的loginInfoController对登录日志进行入库操作
     */
    void saveLogInfo(@PathVariable("username") String username, @PathVariable("resourcesAccessed") String resourcesAccessed);
}
